import service from '@/utils/request.js'
// 将所有的针对permission的请求，都封装到一个对象中
const permissionApi = {
    selectPermissionTree() {
        return service.get('/permission/selectPermissionTree')
    },
    deleteById(id) {
        return service.delete( `/permission/deleteById/${id}`)
    },
    add(permission) {
        //permission以JSON形式传递到后台，后端使用@RequestBody接收
        return service.post('/permission/add', permission)
    },
    selectById(id) {
        return service.get(`/permission/selectById/${id}`)
    },
    update(permission) {
        return service.put('/permission/update', permission)
    }
}

export default permissionApi